<%@page import="cn.sendto.dbhelper.DBHelper"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="getSession.jsp" %>
<%
	//step1:获取参数
	String id = request.getParameter("id");
	//step2:链接数据库进行操作
	DBHelper helper = new DBHelper();

	String sql = "delete from studentinfo where studentid=?";

	int i = helper.executeSQL(sql, id);
	helper.close();
	if(i==0){
		%>
			<script type="text/javascript">
			window.location.href="student_list.jsp";
			alert("删除失败，请重新操作");
			</script>
			
		<%
	}else{
		%>
			<script>
			alert("删除成功");
			window.location.href="student_list.jsp";
			</script>
		<%
	}
	%>
